package androidx.transition;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.TimeInterpolator;
import android.content.Context;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.graphics.Path;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.util.SparseArray;
import android.util.SparseIntArray;
import android.view.InflateException;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.widget.ListView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.core.view.ViewCompat;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;
import o.ds;
import o.dw;
import o.fx;
import o.mw;
import o.ns;
import o.nt;
import o.nv;
import o.nx;
import o.oi;
import o.or;

public abstract class Transition implements Cloneable {
    private static final PathMotion ʻ = new PathMotion() {
        public Path ˏ(float f, float f2, float f3, float f4) {
            Path path = new Path();
            path.moveTo(f, f2);
            path.lineTo(f3, f4);
            return path;
        }
    };
    private static final int[] ˋ = new int[]{2, 1, 3, 4};
    private static ThreadLocal<ds<Animator, e>> ˋˊ = new ThreadLocal();
    private ArrayList<View> ʻॱ = null;
    boolean ʼ = false;
    private ArrayList<nx> ʼॱ;
    ArrayList<Animator> ʽ = new ArrayList();
    private nv ʽॱ = new nv();
    private ArrayList<Class> ʾ = null;
    private int[] ʿ = ˋ;
    private nv ˈ = new nv();
    private boolean ˉ = false;
    ArrayList<View> ˊ = new ArrayList();
    private int ˊˊ = 0;
    private ArrayList<nx> ˊˋ;
    private ArrayList<Integer> ˊॱ = null;
    private ViewGroup ˊᐝ = null;
    private boolean ˋˋ = false;
    private ArrayList<String> ˋॱ = null;
    private d ˋᐝ;
    private ArrayList<Animator> ˌ = new ArrayList();
    private ArrayList<b> ˍ = null;
    ArrayList<Integer> ˎ = new ArrayList();
    private ds<String, String> ˎˎ;
    long ˏ = -1;
    private PathMotion ˏˎ = ʻ;
    private TimeInterpolator ˏॱ = null;
    private ArrayList<Class> ͺ = null;
    TransitionSet ॱ = null;
    private long ॱˊ = -1;
    private ArrayList<Integer> ॱˋ = null;
    private ArrayList<View> ॱˎ = null;
    nt ॱॱ;
    private ArrayList<Class> ॱᐝ = null;
    private String ᐝ = getClass().getName();
    private ArrayList<String> ᐝॱ = null;

    public interface b {
        void ˊ(@NonNull Transition transition);

        void ˋ(@NonNull Transition transition);

        void ˏ(@NonNull Transition transition);

        void ॱ(@NonNull Transition transition);
    }

    public static abstract class d {
        public abstract Rect ˏ(@NonNull Transition transition);
    }

    static class e {
        nx ˊ;
        String ˋ;
        Transition ˎ;
        View ˏ;
        or ॱ;

        e(View view, String str, Transition transition, or orVar, nx nxVar) {
            this.ˏ = view;
            this.ˋ = str;
            this.ˊ = nxVar;
            this.ॱ = orVar;
            this.ˎ = transition;
        }
    }

    public abstract void ˋ(@NonNull nx nxVar);

    public abstract void ॱ(@NonNull nx nxVar);

    public /* synthetic */ Object clone() throws CloneNotSupportedException {
        return ॱˋ();
    }

    public Transition(Context context, AttributeSet attributeSet) {
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, ns.ˏ);
        XmlResourceParser xmlResourceParser = (XmlResourceParser) attributeSet;
        long ˊ = (long) fx.ˊ(obtainStyledAttributes, xmlResourceParser, "duration", 1, -1);
        if (ˊ >= 0) {
            ˎ(ˊ);
        }
        ˊ = (long) fx.ˊ(obtainStyledAttributes, xmlResourceParser, "startDelay", 2, -1);
        if (ˊ > 0) {
            ˋ(ˊ);
        }
        int ˋ = fx.ˋ(obtainStyledAttributes, xmlResourceParser, "interpolator", 0, 0);
        if (ˋ > 0) {
            ˋ(AnimationUtils.loadInterpolator(context, ˋ));
        }
        String ˏ = fx.ˏ(obtainStyledAttributes, xmlResourceParser, "matchOrder", 3);
        if (ˏ != null) {
            ˊ(ॱ(ˏ));
        }
        obtainStyledAttributes.recycle();
    }

    private static int[] ॱ(String str) {
        StringTokenizer stringTokenizer = new StringTokenizer(str, ",");
        Object obj = new int[stringTokenizer.countTokens()];
        int i = 0;
        while (stringTokenizer.hasMoreTokens()) {
            String trim = stringTokenizer.nextToken().trim();
            if ("id".equalsIgnoreCase(trim)) {
                obj[i] = 3;
            } else if ("instance".equalsIgnoreCase(trim)) {
                obj[i] = 1;
            } else if ("name".equalsIgnoreCase(trim)) {
                obj[i] = 2;
            } else if ("itemId".equalsIgnoreCase(trim)) {
                obj[i] = 4;
            } else if (trim.isEmpty()) {
                Object obj2 = new int[(obj.length - 1)];
                System.arraycopy(obj, 0, obj2, 0, i);
                i--;
                obj = obj2;
            } else {
                throw new InflateException("Unknown match type in matchOrder: '" + trim + "'");
            }
            i++;
        }
        return obj;
    }

    @NonNull
    public Transition ˎ(long j) {
        this.ˏ = j;
        return this;
    }

    public long ॱ() {
        return this.ˏ;
    }

    @NonNull
    public Transition ˋ(long j) {
        this.ॱˊ = j;
        return this;
    }

    public long ˊ() {
        return this.ॱˊ;
    }

    @NonNull
    public Transition ˋ(@Nullable TimeInterpolator timeInterpolator) {
        this.ˏॱ = timeInterpolator;
        return this;
    }

    @Nullable
    public TimeInterpolator ˏ() {
        return this.ˏॱ;
    }

    @Nullable
    public String[] ˋ() {
        return null;
    }

    @Nullable
    public Animator ˋ(@NonNull ViewGroup viewGroup, @Nullable nx nxVar, @Nullable nx nxVar2) {
        return null;
    }

    public void ˊ(int... iArr) {
        if (iArr == null || iArr.length == 0) {
            this.ʿ = ˋ;
            return;
        }
        int i = 0;
        while (i < iArr.length) {
            if (!ॱ(iArr[i])) {
                throw new IllegalArgumentException("matches contains invalid value");
            } else if (ˋ(iArr, i)) {
                throw new IllegalArgumentException("matches contains a duplicate value");
            } else {
                i++;
            }
        }
        this.ʿ = (int[]) iArr.clone();
    }

    private static boolean ॱ(int i) {
        return i >= 1 && i <= 4;
    }

    private static boolean ˋ(int[] iArr, int i) {
        int i2 = iArr[i];
        for (int i3 = 0; i3 < i; i3++) {
            if (iArr[i3] == i2) {
                return true;
            }
        }
        return false;
    }

    private void ˎ(ds<View, nx> dsVar, ds<View, nx> dsVar2) {
        for (int size = dsVar.size() - 1; size >= 0; size--) {
            View view = (View) dsVar.ॱ(size);
            if (view != null && ˎ(view)) {
                nx nxVar = (nx) dsVar2.remove(view);
                if (!(nxVar == null || nxVar.ॱ == null || !ˎ(nxVar.ॱ))) {
                    this.ʼॱ.add((nx) dsVar.ˏ(size));
                    this.ˊˋ.add(nxVar);
                }
            }
        }
    }

    private void ॱ(ds<View, nx> dsVar, ds<View, nx> dsVar2, dw<View> dwVar, dw<View> dwVar2) {
        int ˎ = dwVar.ˎ();
        for (int i = 0; i < ˎ; i++) {
            View view = (View) dwVar.ˏ(i);
            if (view != null && ˎ(view)) {
                View view2 = (View) dwVar2.ˋ(dwVar.ˊ(i));
                if (view2 != null && ˎ(view2)) {
                    nx nxVar = (nx) dsVar.get(view);
                    nx nxVar2 = (nx) dsVar2.get(view2);
                    if (!(nxVar == null || nxVar2 == null)) {
                        this.ʼॱ.add(nxVar);
                        this.ˊˋ.add(nxVar2);
                        dsVar.remove(view);
                        dsVar2.remove(view2);
                    }
                }
            }
        }
    }

    private void ˊ(ds<View, nx> dsVar, ds<View, nx> dsVar2, SparseArray<View> sparseArray, SparseArray<View> sparseArray2) {
        int size = sparseArray.size();
        for (int i = 0; i < size; i++) {
            View view = (View) sparseArray.valueAt(i);
            if (view != null && ˎ(view)) {
                View view2 = (View) sparseArray2.get(sparseArray.keyAt(i));
                if (view2 != null && ˎ(view2)) {
                    nx nxVar = (nx) dsVar.get(view);
                    nx nxVar2 = (nx) dsVar2.get(view2);
                    if (!(nxVar == null || nxVar2 == null)) {
                        this.ʼॱ.add(nxVar);
                        this.ˊˋ.add(nxVar2);
                        dsVar.remove(view);
                        dsVar2.remove(view2);
                    }
                }
            }
        }
    }

    private void ˊ(ds<View, nx> dsVar, ds<View, nx> dsVar2, ds<String, View> dsVar3, ds<String, View> dsVar4) {
        int size = dsVar3.size();
        for (int i = 0; i < size; i++) {
            View view = (View) dsVar3.ˋ(i);
            if (view != null && ˎ(view)) {
                View view2 = (View) dsVar4.get(dsVar3.ॱ(i));
                if (view2 != null && ˎ(view2)) {
                    nx nxVar = (nx) dsVar.get(view);
                    nx nxVar2 = (nx) dsVar2.get(view2);
                    if (!(nxVar == null || nxVar2 == null)) {
                        this.ʼॱ.add(nxVar);
                        this.ˊˋ.add(nxVar2);
                        dsVar.remove(view);
                        dsVar2.remove(view2);
                    }
                }
            }
        }
    }

    private void ˋ(ds<View, nx> dsVar, ds<View, nx> dsVar2) {
        int i = 0;
        for (int i2 = 0; i2 < dsVar.size(); i2++) {
            nx nxVar = (nx) dsVar.ˋ(i2);
            if (ˎ(nxVar.ॱ)) {
                this.ʼॱ.add(nxVar);
                this.ˊˋ.add(null);
            }
        }
        while (i < dsVar2.size()) {
            nxVar = (nx) dsVar2.ˋ(i);
            if (ˎ(nxVar.ॱ)) {
                this.ˊˋ.add(nxVar);
                this.ʼॱ.add(null);
            }
            i++;
        }
    }

    private void ˎ(nv nvVar, nv nvVar2) {
        ds dsVar = new ds(nvVar.ˏ);
        ds dsVar2 = new ds(nvVar2.ˏ);
        for (int i : this.ʿ) {
            switch (i) {
                case 1:
                    ˎ(dsVar, dsVar2);
                    break;
                case 2:
                    ˊ(dsVar, dsVar2, nvVar.ˊ, nvVar2.ˊ);
                    break;
                case 3:
                    ˊ(dsVar, dsVar2, nvVar.ॱ, nvVar2.ॱ);
                    break;
                case 4:
                    ॱ(dsVar, dsVar2, nvVar.ˋ, nvVar2.ˋ);
                    break;
                default:
                    break;
            }
        }
        ˋ(dsVar, dsVar2);
    }

    @RestrictTo({androidx.annotation.RestrictTo.d.ˊ})
    protected void ॱ(ViewGroup viewGroup, nv nvVar, nv nvVar2, ArrayList<nx> arrayList, ArrayList<nx> arrayList2) {
        ds ᐝॱ = ᐝॱ();
        long j = Long.MAX_VALUE;
        SparseIntArray sparseIntArray = new SparseIntArray();
        int size = arrayList.size();
        for (int i = 0; i < size; i++) {
            nx nxVar;
            nx nxVar2;
            int i2;
            nx nxVar3 = (nx) arrayList.get(i);
            nx nxVar4 = (nx) arrayList2.get(i);
            if (nxVar3 == null || nxVar3.ˎ.contains(this)) {
                nxVar = nxVar3;
            } else {
                nxVar = null;
            }
            if (nxVar4 == null || nxVar4.ˎ.contains(this)) {
                nxVar2 = nxVar4;
            } else {
                nxVar2 = null;
            }
            if (nxVar != null || nxVar2 != null) {
                Object obj = (nxVar == null || nxVar2 == null || ˎ(nxVar, nxVar2)) ? 1 : null;
                if (obj != null) {
                    Animator ˋ = ˋ(viewGroup, nxVar, nxVar2);
                    if (ˋ != null) {
                        nx nxVar5;
                        Object obj2;
                        View view;
                        nxVar3 = null;
                        if (nxVar2 != null) {
                            Object obj3;
                            View view2 = nxVar2.ॱ;
                            String[] ˋ2 = ˋ();
                            Animator animator;
                            if (view2 == null || ˋ2 == null || ˋ2.length <= 0) {
                                animator = ˋ;
                            } else {
                                nx nxVar6 = new nx();
                                nxVar6.ॱ = view2;
                                nxVar3 = (nx) nvVar2.ˏ.get(view2);
                                if (nxVar3 != null) {
                                    for (i2 = 0; i2 < ˋ2.length; i2++) {
                                        nxVar6.ˊ.put(ˋ2[i2], nxVar3.ˊ.get(ˋ2[i2]));
                                    }
                                }
                                int size2 = ᐝॱ.size();
                                for (i2 = 0; i2 < size2; i2++) {
                                    e eVar = (e) ᐝॱ.get((Animator) ᐝॱ.ॱ(i2));
                                    if (eVar.ˊ != null && eVar.ˏ == view2 && eVar.ˋ.equals(ॱᐝ()) && eVar.ˊ.equals(nxVar6)) {
                                        obj3 = null;
                                        nxVar3 = nxVar6;
                                        break;
                                    }
                                }
                                nxVar3 = nxVar6;
                                animator = ˋ;
                            }
                            nxVar5 = nxVar3;
                            obj2 = obj3;
                            view = view2;
                        } else {
                            view = nxVar.ॱ;
                            nxVar5 = null;
                            Animator animator2 = ˋ;
                        }
                        if (obj2 != null) {
                            if (this.ॱॱ != null) {
                                long ˏ = this.ॱॱ.ˏ(viewGroup, this, nxVar, nxVar2);
                                sparseIntArray.put(this.ˌ.size(), (int) ˏ);
                                j = Math.min(ˏ, j);
                            }
                            ᐝॱ.put(obj2, new e(view, ॱᐝ(), this, oi.ˏ(viewGroup), nxVar5));
                            this.ˌ.add(obj2);
                        }
                    }
                }
            }
        }
        if (j != 0) {
            for (i2 = 0; i2 < sparseIntArray.size(); i2++) {
                Animator animator3 = (Animator) this.ˌ.get(sparseIntArray.keyAt(i2));
                animator3.setStartDelay((((long) sparseIntArray.valueAt(i2)) - j) + animator3.getStartDelay());
            }
        }
    }

    boolean ˎ(View view) {
        int id = view.getId();
        if (this.ˊॱ != null && this.ˊॱ.contains(Integer.valueOf(id))) {
            return false;
        }
        if (this.ॱˎ != null && this.ॱˎ.contains(view)) {
            return false;
        }
        int i;
        if (this.ॱᐝ != null) {
            int size = this.ॱᐝ.size();
            for (i = 0; i < size; i++) {
                if (((Class) this.ॱᐝ.get(i)).isInstance(view)) {
                    return false;
                }
            }
        }
        if (this.ᐝॱ != null && ViewCompat.ॱˎ(view) != null && this.ᐝॱ.contains(ViewCompat.ॱˎ(view))) {
            return false;
        }
        if (this.ˎ.size() == 0 && this.ˊ.size() == 0 && ((this.ͺ == null || this.ͺ.isEmpty()) && (this.ˋॱ == null || this.ˋॱ.isEmpty()))) {
            return true;
        }
        if (this.ˎ.contains(Integer.valueOf(id)) || this.ˊ.contains(view)) {
            return true;
        }
        if (this.ˋॱ != null && this.ˋॱ.contains(ViewCompat.ॱˎ(view))) {
            return true;
        }
        if (this.ͺ == null) {
            return false;
        }
        for (i = 0; i < this.ͺ.size(); i++) {
            if (((Class) this.ͺ.get(i)).isInstance(view)) {
                return true;
            }
        }
        return false;
    }

    private static ds<Animator, e> ᐝॱ() {
        ds<Animator, e> dsVar = (ds) ˋˊ.get();
        if (dsVar != null) {
            return dsVar;
        }
        dsVar = new ds();
        ˋˊ.set(dsVar);
        return dsVar;
    }

    @RestrictTo({androidx.annotation.RestrictTo.d.ˊ})
    protected void ˎ() {
        ॱॱ();
        ds ᐝॱ = ᐝॱ();
        Iterator it = this.ˌ.iterator();
        while (it.hasNext()) {
            Animator animator = (Animator) it.next();
            if (ᐝॱ.containsKey(animator)) {
                ॱॱ();
                ˋ(animator, ᐝॱ);
            }
        }
        this.ˌ.clear();
        ͺ();
    }

    private void ˋ(Animator animator, final ds<Animator, e> dsVar) {
        if (animator != null) {
            animator.addListener(new AnimatorListenerAdapter(this) {
                final /* synthetic */ Transition ˏ;

                public void onAnimationStart(Animator animator) {
                    this.ˏ.ʽ.add(animator);
                }

                public void onAnimationEnd(Animator animator) {
                    dsVar.remove(animator);
                    this.ˏ.ʽ.remove(animator);
                }
            });
            ˋ(animator);
        }
    }

    @NonNull
    public Transition ˊ(@NonNull View view) {
        this.ˊ.add(view);
        return this;
    }

    @NonNull
    public Transition ˏ(@NonNull View view) {
        this.ˊ.remove(view);
        return this;
    }

    @NonNull
    public List<Integer> ʻ() {
        return this.ˎ;
    }

    @NonNull
    public List<View> ʽ() {
        return this.ˊ;
    }

    @Nullable
    public List<String> ʼ() {
        return this.ˋॱ;
    }

    @Nullable
    public List<Class> ᐝ() {
        return this.ͺ;
    }

    public void ˊ(ViewGroup viewGroup, boolean z) {
        int i;
        View findViewById;
        int i2 = 0;
        ॱ(z);
        if ((this.ˎ.size() > 0 || this.ˊ.size() > 0) && ((this.ˋॱ == null || this.ˋॱ.isEmpty()) && (this.ͺ == null || this.ͺ.isEmpty()))) {
            nx nxVar;
            for (i = 0; i < this.ˎ.size(); i++) {
                findViewById = viewGroup.findViewById(((Integer) this.ˎ.get(i)).intValue());
                if (findViewById != null) {
                    nxVar = new nx();
                    nxVar.ॱ = findViewById;
                    if (z) {
                        ˋ(nxVar);
                    } else {
                        ॱ(nxVar);
                    }
                    nxVar.ˎ.add(this);
                    ˊ(nxVar);
                    if (z) {
                        ॱ(this.ʽॱ, findViewById, nxVar);
                    } else {
                        ॱ(this.ˈ, findViewById, nxVar);
                    }
                }
            }
            for (i = 0; i < this.ˊ.size(); i++) {
                findViewById = (View) this.ˊ.get(i);
                nxVar = new nx();
                nxVar.ॱ = findViewById;
                if (z) {
                    ˋ(nxVar);
                } else {
                    ॱ(nxVar);
                }
                nxVar.ˎ.add(this);
                ˊ(nxVar);
                if (z) {
                    ॱ(this.ʽॱ, findViewById, nxVar);
                } else {
                    ॱ(this.ˈ, findViewById, nxVar);
                }
            }
        } else {
            ˏ(viewGroup, z);
        }
        if (!z && this.ˎˎ != null) {
            int size = this.ˎˎ.size();
            ArrayList arrayList = new ArrayList(size);
            for (i = 0; i < size; i++) {
                arrayList.add(this.ʽॱ.ˊ.remove((String) this.ˎˎ.ॱ(i)));
            }
            while (i2 < size) {
                findViewById = (View) arrayList.get(i2);
                if (findViewById != null) {
                    this.ʽॱ.ˊ.put((String) this.ˎˎ.ˋ(i2), findViewById);
                }
                i2++;
            }
        }
    }

    private static void ॱ(nv nvVar, View view, nx nxVar) {
        nvVar.ˏ.put(view, nxVar);
        int id = view.getId();
        if (id >= 0) {
            if (nvVar.ॱ.indexOfKey(id) >= 0) {
                nvVar.ॱ.put(id, null);
            } else {
                nvVar.ॱ.put(id, view);
            }
        }
        String ॱˎ = ViewCompat.ॱˎ(view);
        if (ॱˎ != null) {
            if (nvVar.ˊ.containsKey(ॱˎ)) {
                nvVar.ˊ.put(ॱˎ, null);
            } else {
                nvVar.ˊ.put(ॱˎ, view);
            }
        }
        if (view.getParent() instanceof ListView) {
            ListView listView = (ListView) view.getParent();
            if (listView.getAdapter().hasStableIds()) {
                long itemIdAtPosition = listView.getItemIdAtPosition(listView.getPositionForView(view));
                if (nvVar.ˋ.ˊ(itemIdAtPosition) >= 0) {
                    View view2 = (View) nvVar.ˋ.ˋ(itemIdAtPosition);
                    if (view2 != null) {
                        ViewCompat.ˋ(view2, false);
                        nvVar.ˋ.ˎ(itemIdAtPosition, null);
                        return;
                    }
                    return;
                }
                ViewCompat.ˋ(view, true);
                nvVar.ˋ.ˎ(itemIdAtPosition, view);
            }
        }
    }

    public void ॱ(boolean z) {
        if (z) {
            this.ʽॱ.ˏ.clear();
            this.ʽॱ.ॱ.clear();
            this.ʽॱ.ˋ.ˊ();
            return;
        }
        this.ˈ.ˏ.clear();
        this.ˈ.ॱ.clear();
        this.ˈ.ˋ.ˊ();
    }

    private void ˏ(View view, boolean z) {
        if (view != null) {
            int id = view.getId();
            if (this.ˊॱ != null && this.ˊॱ.contains(Integer.valueOf(id))) {
                return;
            }
            if (this.ॱˎ == null || !this.ॱˎ.contains(view)) {
                int i;
                if (this.ॱᐝ != null) {
                    int size = this.ॱᐝ.size();
                    i = 0;
                    while (i < size) {
                        if (!((Class) this.ॱᐝ.get(i)).isInstance(view)) {
                            i++;
                        } else {
                            return;
                        }
                    }
                }
                if (view.getParent() instanceof ViewGroup) {
                    nx nxVar = new nx();
                    nxVar.ॱ = view;
                    if (z) {
                        ˋ(nxVar);
                    } else {
                        ॱ(nxVar);
                    }
                    nxVar.ˎ.add(this);
                    ˊ(nxVar);
                    if (z) {
                        ॱ(this.ʽॱ, view, nxVar);
                    } else {
                        ॱ(this.ˈ, view, nxVar);
                    }
                }
                if (!(view instanceof ViewGroup)) {
                    return;
                }
                if (this.ॱˋ != null && this.ॱˋ.contains(Integer.valueOf(id))) {
                    return;
                }
                if (this.ʻॱ == null || !this.ʻॱ.contains(view)) {
                    if (this.ʾ != null) {
                        id = this.ʾ.size();
                        i = 0;
                        while (i < id) {
                            if (!((Class) this.ʾ.get(i)).isInstance(view)) {
                                i++;
                            } else {
                                return;
                            }
                        }
                    }
                    ViewGroup viewGroup = (ViewGroup) view;
                    for (int i2 = 0; i2 < viewGroup.getChildCount(); i2++) {
                        ˏ(viewGroup.getChildAt(i2), z);
                    }
                }
            }
        }
    }

    @Nullable
    public nx ˊ(@NonNull View view, boolean z) {
        if (this.ॱ != null) {
            return this.ॱ.ˊ(view, z);
        }
        return (nx) (z ? this.ʽॱ : this.ˈ).ˏ.get(view);
    }

    nx ˎ(View view, boolean z) {
        if (this.ॱ != null) {
            return this.ॱ.ˎ(view, z);
        }
        ArrayList arrayList = z ? this.ʼॱ : this.ˊˋ;
        if (arrayList == null) {
            return null;
        }
        nx nxVar;
        int size = arrayList.size();
        int i = 0;
        while (i < size) {
            nxVar = (nx) arrayList.get(i);
            if (nxVar == null) {
                return null;
            }
            if (nxVar.ॱ == view) {
                break;
            }
            i++;
        }
        i = -1;
        if (i >= 0) {
            nxVar = (nx) (z ? this.ˊˋ : this.ʼॱ).get(i);
        } else {
            nxVar = null;
        }
        return nxVar;
    }

    @RestrictTo({androidx.annotation.RestrictTo.d.ˊ})
    public void ˋ(View view) {
        if (!this.ˋˋ) {
            ds ᐝॱ = ᐝॱ();
            int size = ᐝॱ.size();
            or ˏ = oi.ˏ(view);
            for (int i = size - 1; i >= 0; i--) {
                e eVar = (e) ᐝॱ.ˋ(i);
                if (eVar.ˏ != null && ˏ.equals(eVar.ॱ)) {
                    mw.ˎ((Animator) ᐝॱ.ॱ(i));
                }
            }
            if (this.ˍ != null && this.ˍ.size() > 0) {
                ArrayList arrayList = (ArrayList) this.ˍ.clone();
                int size2 = arrayList.size();
                for (int i2 = 0; i2 < size2; i2++) {
                    ((b) arrayList.get(i2)).ˊ(this);
                }
            }
            this.ˉ = true;
        }
    }

    @RestrictTo({androidx.annotation.RestrictTo.d.ˊ})
    public void ᐝ(View view) {
        if (this.ˉ) {
            if (!this.ˋˋ) {
                ds ᐝॱ = ᐝॱ();
                int size = ᐝॱ.size();
                or ˏ = oi.ˏ(view);
                for (int i = size - 1; i >= 0; i--) {
                    e eVar = (e) ᐝॱ.ˋ(i);
                    if (eVar.ˏ != null && ˏ.equals(eVar.ॱ)) {
                        mw.ॱ((Animator) ᐝॱ.ॱ(i));
                    }
                }
                if (this.ˍ != null && this.ˍ.size() > 0) {
                    ArrayList arrayList = (ArrayList) this.ˍ.clone();
                    int size2 = arrayList.size();
                    for (int i2 = 0; i2 < size2; i2++) {
                        ((b) arrayList.get(i2)).ˏ(this);
                    }
                }
            }
            this.ˉ = false;
        }
    }

    public void ˋ(ViewGroup viewGroup) {
        this.ʼॱ = new ArrayList();
        this.ˊˋ = new ArrayList();
        ˎ(this.ʽॱ, this.ˈ);
        ds ᐝॱ = ᐝॱ();
        int size = ᐝॱ.size();
        or ˏ = oi.ˏ(viewGroup);
        for (int i = size - 1; i >= 0; i--) {
            Animator animator = (Animator) ᐝॱ.ॱ(i);
            if (animator != null) {
                e eVar = (e) ᐝॱ.get(animator);
                if (!(eVar == null || eVar.ˏ == null || !ˏ.equals(eVar.ॱ))) {
                    nx nxVar = eVar.ˊ;
                    View view = eVar.ˏ;
                    nx ˊ = ˊ(view, true);
                    nx ˎ = ˎ(view, true);
                    boolean z = !(ˊ == null && ˎ == null) && eVar.ˎ.ˎ(nxVar, ˎ);
                    if (z) {
                        if (animator.isRunning() || animator.isStarted()) {
                            animator.cancel();
                        } else {
                            ᐝॱ.remove(animator);
                        }
                    }
                }
            }
        }
        ॱ(viewGroup, this.ʽॱ, this.ˈ, this.ʼॱ, this.ˊˋ);
        ˎ();
    }

    public boolean ˎ(@Nullable nx nxVar, @Nullable nx nxVar2) {
        if (nxVar == null || nxVar2 == null) {
            return false;
        }
        String[] ˋ = ˋ();
        if (ˋ != null) {
            boolean z;
            for (String ॱ : ˋ) {
                if (ॱ(nxVar, nxVar2, ॱ)) {
                    z = true;
                    break;
                }
            }
            z = false;
            return z;
        }
        for (String ॱ2 : nxVar.ˊ.keySet()) {
            if (ॱ(nxVar, nxVar2, ॱ2)) {
                return true;
            }
        }
        return false;
    }

    private static boolean ॱ(nx nxVar, nx nxVar2, String str) {
        Object obj = nxVar.ˊ.get(str);
        Object obj2 = nxVar2.ˊ.get(str);
        if (obj == null && obj2 == null) {
            return false;
        }
        if (obj == null || obj2 == null || !obj.equals(obj2)) {
            return true;
        }
        return false;
    }

    @RestrictTo({androidx.annotation.RestrictTo.d.ˊ})
    protected void ˋ(Animator animator) {
        if (animator == null) {
            ͺ();
            return;
        }
        if (ॱ() >= 0) {
            animator.setDuration(ॱ());
        }
        if (ˊ() >= 0) {
            animator.setStartDelay(ˊ());
        }
        if (ˏ() != null) {
            animator.setInterpolator(ˏ());
        }
        animator.addListener(new AnimatorListenerAdapter(this) {
            final /* synthetic */ Transition ˏ;

            {
                this.ˏ = r1;
            }

            public void onAnimationEnd(Animator animator) {
                this.ˏ.ͺ();
                animator.removeListener(this);
            }
        });
        animator.start();
    }

    @RestrictTo({androidx.annotation.RestrictTo.d.ˊ})
    protected void ॱॱ() {
        if (this.ˊˊ == 0) {
            if (this.ˍ != null && this.ˍ.size() > 0) {
                ArrayList arrayList = (ArrayList) this.ˍ.clone();
                int size = arrayList.size();
                for (int i = 0; i < size; i++) {
                    ((b) arrayList.get(i)).ॱ(this);
                }
            }
            this.ˋˋ = false;
        }
        this.ˊˊ++;
    }

    @RestrictTo({androidx.annotation.RestrictTo.d.ˊ})
    protected void ͺ() {
        this.ˊˊ--;
        if (this.ˊˊ == 0) {
            int i;
            View view;
            if (this.ˍ != null && this.ˍ.size() > 0) {
                ArrayList arrayList = (ArrayList) this.ˍ.clone();
                int size = arrayList.size();
                for (int i2 = 0; i2 < size; i2++) {
                    ((b) arrayList.get(i2)).ˋ(this);
                }
            }
            for (i = 0; i < this.ʽॱ.ˋ.ˎ(); i++) {
                view = (View) this.ʽॱ.ˋ.ˏ(i);
                if (view != null) {
                    ViewCompat.ˋ(view, false);
                }
            }
            for (i = 0; i < this.ˈ.ˋ.ˎ(); i++) {
                view = (View) this.ˈ.ˋ.ˏ(i);
                if (view != null) {
                    ViewCompat.ˋ(view, false);
                }
            }
            this.ˋˋ = true;
        }
    }

    @NonNull
    public Transition ˊ(@NonNull b bVar) {
        if (this.ˍ == null) {
            this.ˍ = new ArrayList();
        }
        this.ˍ.add(bVar);
        return this;
    }

    @NonNull
    public Transition ॱ(@NonNull b bVar) {
        if (this.ˍ != null) {
            this.ˍ.remove(bVar);
            if (this.ˍ.size() == 0) {
                this.ˍ = null;
            }
        }
        return this;
    }

    public void ॱ(@Nullable PathMotion pathMotion) {
        if (pathMotion == null) {
            this.ˏˎ = ʻ;
        } else {
            this.ˏˎ = pathMotion;
        }
    }

    @NonNull
    public PathMotion ˋॱ() {
        return this.ˏˎ;
    }

    public void ˎ(@Nullable d dVar) {
        this.ˋᐝ = dVar;
    }

    @Nullable
    public d ˏॱ() {
        return this.ˋᐝ;
    }

    @Nullable
    public Rect ˊॱ() {
        if (this.ˋᐝ == null) {
            return null;
        }
        return this.ˋᐝ.ˏ(this);
    }

    public void ˊ(@Nullable nt ntVar) {
        this.ॱॱ = ntVar;
    }

    @Nullable
    public nt ॱˊ() {
        return this.ॱॱ;
    }

    void ˊ(nx nxVar) {
        Object obj = null;
        if (this.ॱॱ != null && !nxVar.ˊ.isEmpty()) {
            String[] ॱ = this.ॱॱ.ॱ();
            if (ॱ != null) {
                for (Object containsKey : ॱ) {
                    if (!nxVar.ˊ.containsKey(containsKey)) {
                        break;
                    }
                }
                int i = 1;
                if (obj == null) {
                    this.ॱॱ.ˏ(nxVar);
                }
            }
        }
    }

    public String toString() {
        return ˎ("");
    }

    public Transition ॱˋ() {
        try {
            Transition transition = (Transition) super.clone();
            transition.ˌ = new ArrayList();
            transition.ʽॱ = new nv();
            transition.ˈ = new nv();
            transition.ʼॱ = null;
            transition.ˊˋ = null;
            return transition;
        } catch (CloneNotSupportedException e) {
            return null;
        }
    }

    @NonNull
    public String ॱᐝ() {
        return this.ᐝ;
    }

    String ˎ(String str) {
        int i = 0;
        String str2 = str + getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + ": ";
        if (this.ˏ != -1) {
            str2 = str2 + "dur(" + this.ˏ + ") ";
        }
        if (this.ॱˊ != -1) {
            str2 = str2 + "dly(" + this.ॱˊ + ") ";
        }
        if (this.ˏॱ != null) {
            str2 = str2 + "interp(" + this.ˏॱ + ") ";
        }
        if (this.ˎ.size() <= 0 && this.ˊ.size() <= 0) {
            return str2;
        }
        String str3;
        str2 = str2 + "tgts(";
        if (this.ˎ.size() > 0) {
            str3 = str2;
            for (int i2 = 0; i2 < this.ˎ.size(); i2++) {
                if (i2 > 0) {
                    str3 = str3 + ", ";
                }
                str3 = str3 + this.ˎ.get(i2);
            }
        } else {
            str3 = str2;
        }
        if (this.ˊ.size() > 0) {
            while (i < this.ˊ.size()) {
                if (i > 0) {
                    str3 = str3 + ", ";
                }
                str3 = str3 + this.ˊ.get(i);
                i++;
            }
        }
        return str3 + ")";
    }
}
